package com.ruoyi.base.service.impl;

import com.ruoyi.base.domain.Warehouse;
import com.ruoyi.base.mapper.WarehouseMapper;
import com.ruoyi.base.service.IWarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 仓库管理Service业务层处理
 *
 * @author ruoyi
 * @date 2023-04-28
 */
@Service
public class WarehouseServiceImpl implements IWarehouseService {
    @Autowired
    private WarehouseMapper warehouseMapper;

    /**
     * 查询仓库管理
     *
     * @param WarehouseID 仓库管理主键
     * @return 仓库管理
     */
    @Override
    public Warehouse selectWarehouseByWarehouseID(Long WarehouseID) {
        return warehouseMapper.selectWarehouseByWarehouseID(WarehouseID);
    }

    /**
     * 查询仓库管理列表
     *
     * @param warehouse 仓库管理
     * @return 仓库管理
     */
    @Override
    public List<Warehouse> selectWarehouseList(Warehouse warehouse) {
        return warehouseMapper.selectWarehouseList(warehouse);
    }

    /**
     * 新增仓库管理
     *
     * @param warehouse 仓库管理
     * @return 结果
     */
    @Override
    public int insertWarehouse(Warehouse warehouse) {
        return warehouseMapper.insertWarehouse(warehouse);
    }

    /**
     * 修改仓库管理
     *
     * @param warehouse 仓库管理
     * @return 结果
     */
    @Override
    public int updateWarehouse(Warehouse warehouse) {
        return warehouseMapper.updateWarehouse(warehouse);
    }

    /**
     * 批量删除仓库管理
     *
     * @param WarehouseIDs 需要删除的仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseByWarehouseIDs(Long[] WarehouseIDs) {
        return warehouseMapper.deleteWarehouseByWarehouseIDs(WarehouseIDs);
    }

    /**
     * 删除仓库管理信息
     *
     * @param WarehouseID 仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseByWarehouseID(Long WarehouseID) {
        return warehouseMapper.deleteWarehouseByWarehouseID(WarehouseID);
    }

    /**
     * 查询所有的仓库
     * @return
     */
    @Override
    public List<Warehouse> selectWarehouseAll() {
        return warehouseMapper.selectWarehouseAll();
    }

}
